/**
 * ScreenItemTag.java
 * Product:BaseLayer
 * Version:1.0
 * Copyright 2009 by DNE
 * All Rights Reserved.
 */
package com.site.util.taglib;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

import com.site.util.MessageUtils;
import com.site.util.StringUtils;


/**
 * screenItem显示标签
 * @author zhangzhi  Jan 21, 2009
 */
public class ScreenItemTag extends TagSupport {
	/**
	 * 
	 */
	private static final long serialVersionUID = 8675068382903516685L;
	private String key;
	@Override
	public int doStartTag() throws JspException {
		String message="";
		if(!StringUtils.isEmpty(key)){
			message=MessageUtils.getScreenItem(key,(HttpServletRequest)pageContext.getRequest());
		}
		try {
			pageContext.getOut().write(message);
		} catch (IOException e) {
			e.printStackTrace();
			System.err.println("ScreenItemTag标签出错！");
		}
		return super.doStartTag();
	}
	public String getKey() {
		return key;
	}
	public void setKey(String key) {
		this.key = key;
	}
}
